"""评估诊断服务"""
from app.ai.evaluation_engine import get_evaluation_engine
from app.ai.recommendation_service import get_recommendation_service
from app.models.assessment import InitialAssessmentResult, WeaknessAnalysis
from typing import Dict, Any


class AssessmentService:
    """评估诊断服务类"""
    
    def __init__(self):
        self.evaluation_engine = get_evaluation_engine()
        self.recommendation_service = get_recommendation_service()
    
    async def evaluate_initial_assessment(
        self,
        user_id: str,
        assessment_data: Dict[str, Any]
    ) -> InitialAssessmentResult:
        """初始能力评估"""
        return await self.evaluation_engine.evaluate_initial_assessment(
            user_id, assessment_data
        )
    
    async def analyze_weaknesses(
        self,
        user_id: str,
        answer_records: list,
        time_period_days: int = 30
    ) -> WeaknessAnalysis:
        """薄弱环节分析"""
        return await self.evaluation_engine.analyze_weaknesses(
            user_id, answer_records, time_period_days
        )
    
    async def create_study_plan(
        self,
        user_id: str,
        duration_days: int,
        current_level: float = 70.0
    ) -> Dict[str, Any]:
        """创建学习计划"""
        return await self.recommendation_service.recommend_training_plan(
            user_id, duration_days, current_level
        )


assessment_service = AssessmentService()

